import numpy as np

lst=np.arange(1,11).reshape([2,-1])
print(lst)
print(np.exp(lst))
print(np.exp2(lst))
print(np.sqrt(lst))
print(np.sin(lst))
print(np.log(lst))

lst=np.array([[[1,2,3,4],
               [4,5,6,7]],
              [[7,8,9,10],
               [10,11,12,13]],
              [[14,15,16,17],
               [18,19,20,21]]
               ])
print(lst.sum(axis=2))
print(lst.max(axis=1))
print(lst.min(axis=0))

lst1=np.array([10,20,30,40])
lst2=np.array([4,3,2,1])
print(lst1+lst2)
print(lst1-lst2)
print(lst1*lst2)
print(lst1/lst2)
print(lst1**2)
lst3=lst2.reshape([2,2])
print(np.dot(lst1.reshape([2,2]),lst3))
print(np.ravel(lst3),np.ravel(lst3,order='F'))

print(np.concatenate((lst1,lst2),axis=0))
print(np.vstack((lst1,lst2)))
print(np.hstack((lst1,lst2)))
print(np.split(lst1,4))
print(np.copy(lst1))

a=np.ones((1,4,3))
b=np.moveaxis(a,0,-1)
c=np.swapaxes(a,0,2)
print(a,b,c)
print(a.shape,b.shape,c.shape)

a=np.atleast_1d([1,2,3])
b=np.atleast_2d([4,5,6])
c=np.atleast_3d([7,8,9])
print(a,b,c)
